<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>vue-router-hash</title>
    <script src="https://cdn.jsdelivr.net/npm/vue@2.6.14/dist/vue.js"></script>
    <script src="./vue-router-hash.js"></script>
  </head>
  <body>
    <div id="app">
      <router-link to="/">首页</router-link>
      <router-link to="/about">关于</router-link>
      <router-view></router-view>
    </div>
  </body>
  <script>
    Vue.use(VueRouterHash)
    const routes = [
      {path: '/', component: '<h1>首页</h1>'},
      {path: '/about', component: '<h1>关于</h1>'}
    ]
    const router = new VueRouterHash({
      routes // (缩写) 相当于 routes: routes
    })
    new Vue({
      el: '#app',
      router,
    })
  </script>
</html>
